<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<jsp:include page="../common/common.jsp" />
</head>
<body class="page-header-fixed">
	<jsp:include page="../common/header.jsp" />

	<div class="clearfix"></div>
	<div class="page-container">
		<div class="page-sidebar-wrapper"><jsp:include
				page="../common/menu.jsp" /></div>
		<div class="page-content-wrapper">
			<div class="page-content">
				<div class="row">
					<div class="col-md-12">
						<form class="form-horizontal form-row-seperated" id="form"
							method="post" action="${path}/chatRobot/save">
							<div class="portlet box purple">
								<div class="portlet-title">
									<div class="caption">
										<i class="fa fa-shopping-cart"></i>基础数据详细内容
									</div>
									<div class="actions btn-set">
										<a href="javascript:history.go(-1);" class="btn default"><i
											class="fa fa-angle-left"></i> 返回</a>
										<button type="button" onclick="save()" class="btn blue">
											<i class="fa fa-check"></i> 保存
										</button>
									</div>
								</div>
								<div class="portlet-body">
									<div class="tabbable">
										<div class="tab-content no-space">
											<div class="tab-pane active" id="tab_general">
												<div class="form-body">

													<div class="form-group">
														<label class="col-md-2 control-label">直播间名字: <span
															class="required"> </span>
														</label>

													
															<input type="hidden" id="livename" name="livename"
																class="form-control measure-input"
																value="${data.livename}" />
													
														<div class="col-md-3">
															<select id="liveId" name="liveId" onchange="cklive(this)" class="form-control">
														
															<c:if test="${data.id==null&&liveId!=0}">
															<option value="0" selected="selected">请选择</option>
																<c:forEach items="${datalists }" var="datalist">
																	<option value="${datalist.id }" <c:if test="${liveId==datalist.id}">selected="selected" </c:if>>${datalist.name }</option>
																</c:forEach>							
															</c:if>
															</select>
														</div>
														<div class="col-md-5">
															<!--                                                         &nbsp;可输入<b><span id="title_len">32</span></b> 个字符 -->
														</div>
													</div>
													
													<div class="form-group">
														<label class="col-md-2 control-label">选择留言类别: <span
															class="required"> </span>
														</label>

														<div class="col-md-5">
															<!--  <c:forEach items="${confdata}" var="c">
                                                   					 <input type="checkbox" value="${c.id}" name="chattype" > ${c.value0}
                                              					  </c:forEach> -->
                                              					   <input type="checkbox" value="1" name="chattype" > 文字
                                              					    <input type="checkbox" value="2" name="chattype" > 图片
                                              				
														</div>
														<div class="col-md-5">
															<!--                                                         &nbsp;可输入<b><span id="title_len">32</span></b> 个字符 -->
														</div>
													</div>
														<div class="form-group">
														<label class="col-md-2 control-label">开始-结束时间:<span
															class="required">*</span>
														</label>
														<div class="col-md-4" style="width:40%;">
															<div style="width:400px;"
																class="input-group input-large date-picker input-daterange"
																data-date-format="yyyy-mm-dd">
																<input type="text" class="form-control" id="startTime"
																	name="startTime" value="${data.startTime}"
																	readonly="readonly"
																	onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
																<span class="input-group-addon">to</span> <input
																	type="text" class="form-control" id="endTime"
																	name="endTime" value="${data.endTime}"
																	readonly="readonly"
																	onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
															</div>
														</div>
													</div>
  									
													<div class="form-group">
														<label class="col-md-2 control-label">条数: <span
															class="required"> </span>
														</label>

														<div class="col-md-5">
															<input type="text" id="chatNumber" name="chatNumber"
																class="form-control measure-input"
																value="${data.chatNumber}" />
														</div>
														<div class="col-md-5">
															<!--                                                         &nbsp;可输入<b><span id="title_len">32</span></b> 个字符 -->
														</div>
													</div>
													
												     
												</div>
											</div>
										</div>
									</div>
								</div>

								<div class="portlet-title">
									<div class="actions btn-set">
										<a href="javascript:history.go(-1);" class="btn default"><i
											class="fa fa-angle-left"></i> 返回</a>
										<button type="button" onclick="save()" class="btn blue">
											<i class="fa fa-check"></i> 保存
										</button>
									</div>
								</div>
							</div>
							<input type="hidden" id="id" name="id" value="${data.id}">
							 
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="../common/footer.jsp" />
	<script type="text/javascript" src="${path}/assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
	<script type="text/javascript" src="${path}/assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/jquery.input-ip-address-control-1.0.min.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/biz/ajaxfileupload.js"></script>
	<script type="text/javascript"
		src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
	<script>
	function save(){
		if(isok){

							$("#form").submit();
						
	}

	}	
	    function isok() {
	    	//非空验证
	    	if($("#livename").val()==""){
	    		alert("直播名称不能为空!");
	            return;
	    	}
	    	
	    	
	}
	    
		function cklive(em){
			   
			  $("#livename").val($(em).find("option:selected").text())
			if(liveId=='0'){
				layer.alert("请选择直播间", {
	  		        icon: 2,
	  		        offset: 'middle',
	  		        time: 3000, 
	  		        skin: 'layui-layer-lan'
	  		    });
				return false;
			}else{
				return true;
			}
		}
	</script>
</body>
</html>